package Observer;

import java.util.ArrayList;
import java.util.List;

public class NewsPaperImp implements Newspaper {

    protected List<Observer> observers = new ArrayList<>();


    @Override
    public void registerObServer(Observer observer) {
        observers.add(observer);
    }

    @Override
    public void unRegisterObserver(Observer observer) {
        observers.remove(observer);
    }

    @Override
    public void notifyObserver(String message) {
        for (Observer observer : observers){
            observer.update(message);
        }
    }
}
